<?php

/**
 * @name: HOTN Scroller
 * @author: HammerOnTheNail
 * @link: http://code.google.com/p/hotnscroller/
 */

$eplug_admin = TRUE;
include("../../../class2.php"); 
include(e_ADMIN."auth.php");
include(e_PLUGIN."hotn_scroller/languages/".e_LANGUAGE.".php");
include(e_PLUGIN."hotn_scroller/class/scroller_form.php");
include(e_PLUGIN."hotn_scroller/class/scroller_options.php");

// Admin jog vizsgálata
if(!getperms("P"))
{ 
	header("location:".e_BASE."index.php"); 
}

// Paraméterek tömbbé alakítása
if(e_QUERY)
{
	$qs = explode(".", e_QUERY);
}

//--- Body
// Alap állapot megjelenítése
$text = HOTN_SCROLLER_ADMIN_DEFAULT_TEXT;
$title = HOTN_SCROLLER_ADMIN_DEFAULT_TITLE;

// Hibakezelés
if ( isset($qs[2]) && $qs[2]<>"action" )
{
	if ($qs[0] == "ittem")
	{
		if ($qs[1] == "add")
		{
			$error_text = HOTN_SCROLLER_ADMIN_ITTEM_ADD;			
		}
		
		if ($qs[1] == "list")
		{
			if ($qs[2] == "delete") $error_text = HOTN_SCROLLER_ADMIN_ITTEM_DELETE;
			if ($qs[2] == "no_select") $error_text = HOTN_SCROLLER_ADMIN_ITTEM_NO_SELECT;
			if ($qs[2] == "edit") $error_text = HOTN_SCROLLER_ADMIN_ITTEM_EDIT;
		}
		
	}
	
	if ($qs[0] == "options")
	{
		$error_text = HOTN_SCROLLER_ADMIN_OPTIONS_SAVE;
	}
	
	$ns -> tablerender(HOTN_ANIMELIST_ADMIN_DEFAULT_ERROR_TITLE, $error_text);
}

// Aloldal beolvasása
if (isset($qs[0]) && isset($qs[1])) include(e_PLUGIN."hotn_scroller/admin/admin_".$qs[0]."_".$qs[1].".php");

// Adatok megjelenítése
$ns -> tablerender($title, $text);
include(e_ADMIN."footer.php");

// Admin menü
function admin_index_adminmenu()
{
	global $qs;
	$act = $qs[0].".".$qs[1];

	$var['ittem.add']['text'] = HOTN_SCROLLER_ADMIN_MENU_ITTEM_ADD;
	$var['ittem.add']['link'] = e_SELF."?ittem.add";

	$var['ittem.list']['text'] = HOTN_SCROLLER_ADMIN_MENU_ITTEM_LIST;
	$var['ittem.list']['link'] = e_SELF."?ittem.list";
	
	show_admin_menu(HOTN_SCROLLER_ADMIN_MENU_ITTEM, $act, $var);
	$var = array();
	
	$var['options.edit']['text'] = HOTN_SCROLLER_ADMIN_MENU_OPTIONS_EDIT;
	$var['options.edit']['link'] = e_SELF."?options.edit";
	
	show_admin_menu(HOTN_SCROLLER_ADMIN_MENU_OPTIONS, $act, $var);
	
}
?>